home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / graphics / amicad / arexx_english / selectparts.amicad < prev    next >
Text File  |  1999-12-06  |  2KB  |  64 lines

  1. /* This script selects all the components with the same name
  2.    $VER: SelectParts.AmiCAD 1.03e (© R.Florac, 22 mai 1999) */
  3.  
  4. options results
  5.  
  6. signal on error     /* error handling */
  7. signal on syntax
  8.  
  9. 'FIRSTSEL'; objet = result
  10. if objet = 0 then do
  11.     'COMPOSANT=ASKTEXT("What''s the name of"+CHR(10)+"the searched component ?"+CHR(10)+"Wild chars can be used"+CHR(10)+"Ex: Diod#?","")'
  12.     part=result
  13.     if part="" then exit
  14. end
  15. else do
  16.     'COMPOSANT=PARTNAME('objet')'
  17.     part=result
  18.     if part="" then do
  19.     'TYPE('objet')'; type=result
  20.     'SECURITY(OBJECTS(-1)+10):FOR(I=1:N=0,I<=OBJECTS(-1),IF(TYPE(I)=='type',MARK(I):N=N+1,0),I=I+1)'
  21.     'N'; n=result
  22.     affichage(n,type)
  23.     exit
  24.     end
  25. end
  26. 'SECURITY(OBJECTS(-1)+10):N=0:I=0:WHILE(I=IF(I+1<=OBJECTS(-1),FINDPART(I+1,COMPOSANT),0),MARK(I):N=N+1)'
  27. 'N'; n=result
  28. affichage(n,1)
  29.  
  30. exit
  31.  
  32. affichage: procedure expose part
  33.     parse arg nombre, type
  34.     select
  35.     when type = 1 then element = part
  36.     when type = 2 then element = "wire"
  37.     when type = 3 then element = "arc"
  38.     when type = 4 then element = "text"
  39.     when type = 5 then element = "component reference"
  40.     when type = 6 then element = "component value"
  41.     when type = 7 then element = "junction"
  42.     when type = 8 then element = "dashed line"
  43.     when type = 9 then element = "bus"
  44.     when type = 10 then element = "ellipse"
  45.     when type = 11 then element = "input connector"
  46.     when type = 12 then element = "output connector"
  47.     when type = 15 then element = "double line"
  48.     when type = 21 then element = "other line"
  49.     when type = 22 then element = "box"
  50.     otherwise element = "object"
  51.     end
  52.     'MESSAGE("Selected object type:"+CHR(10)+"'element'"+CHR(10)+"Found: 'nombre'")'
  53.     exit
  54. end
  55.  
  56. syntax:
  57. erreur=RC
  58. 'MESSAGE("Script SelectParts"+CHR(10)+"Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
  59. exit
  60.  
  61. error:
  62. 'MESSAGE("Script SelectParts"+CHR(10)+"Error in line 'SIGL'")'
  63. exit
  64.